﻿class @AuthorsRoutes extends Backbone.Router
    routes:
        "Authors/Listing*path": "Listing"
        "Authors/Show/:authorId": "Show"

    Listing: ->
        layout = new LibraryLayoutView()
        model = new AuthorsModel()
        model.set("Letter", Url.GetParameterByName("letter"))
        view = new AuthorView(model: model)

    Show: (authorId) ->
        layout = new LibraryLayoutView()
        model = new AuthorsBooksModel()
        model.set("AuthorId", authorId)
        view = new AuthorsBooksView(model: model)